<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/tld/util.tld" prefix="myutil" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
    <head>
        <title>吉鸿商城</title>
        <meta http-equiv = "Content-Type" content = "text/html; charset=utf-8"/>
        <link href = "/ecp/resources/css/default/base.css" rel = "stylesheet" type = "text/css"/>
        <script type="text/javascript" src="/ecp/resources/js/jquery-1.8.1.js"></script>
        <script type="text/javascript" src="/ecp/resources/js/tydic.js"></script>
        <script type = "text/javascript">
         jQuery(function($) {
			dicPath = '/ecp/resources/css/default/images/';
		});
        
            jQuery(function($) {
            var cfg = {
					url : '/ecp/backstage/order/queryOrder.do',//分页请求url设置
					head : [//表头设置
					{dis:'选择' , name:'id',width:'2%', align:'left', checked : true},
					{dis:'客户账号', name:'account', width:'8%', align:'right',
					link : {fun : function(data) {window.location.href="/ecp/backstage/order/toOrderInfo.do?menuId=${param.menuId}&&id="+data['id'];}}},
					{dis:'创建时间', name:'addtime', width:'8%', align:'center', sort : {style : false}},
					{dis:'价格（元）', name:'price', width:'8%', align:'right'},
					{dis:'订单状态', name:'status', width:'8%', align:'right'},
					{dis:'订单类型', name:'type', width:'8%', align:'right',replace : function(data) {return ('2'==data['type'] ? '积分订单':'货币订单') }},
					{dis:'操作', name:'操作', width:'15%', align:'center'}
					],
					action : [//表格操作设置(修改,删除)
						{name:'修改订单状态',
						 fun:function(m){ 
						    window.location.href="/ecp/backstage/order/toUpdateOrderStatus.do?menuId=${param.menuId}&&id="+m.id;
						 }, 
						show:function(m){
						  if (m) return true;
						}}//表格[修改设置 | 权限设置(显示,需要有返回值)]
						 
						]
					}
            
                $('#button2').click(function() {
                     var param = $("#paramForm").serialize()+"&"+new Date() ;
                     cfg.url = '/ecp/backstage/order/queryOrder.do?'+param;
                    //  var table = $('#datatable').dicTable(cfg);
                    $('#datatable').html("").append("<div id='datatable2'></div>");;
                    var table = $('#datatable2').dicTable(cfg);
                });

                var table = $('#datatable2').dicTable(cfg);

                window.parent.layout.left = true;
                window.parent.layout.bottom = true;
                window.parent.layout.draw();
                window.parent.layoutLeft.$('#t').text();
            });
            
		
        </script>
    </head>

    <body>
        <myutil:munuPaht menueId='${param.menuId}'/>
        <table border = "0" cellspacing = "0" cellpadding = "0">
            <tr>
                <td width = "40"><img src = "/ecp/resources/css/default/images/space.gif" class = "img-search"/></td>
                <td>
                    <form action="" id="paramForm" accept-charset="UTF-8">
                    <table border = "0" cellpadding = "0" cellspacing = "0" class = "searchtab fl">
                        <tbody>
                        <tr>
                            <th>账户：</th>
                            <td><input name = "account" type = "text" class = "input90"/></td>
                            <th>姓名：</th>
                            <td><input name = "name" type = "text" class = "input90"/></td>
                            <th>订单状态：</th>
                            <td><select name="status" class = "input120">
						           <c:forEach items="${orderStatus}" var="status">
					               <option value="${status.key}">${status.value}</option>
					              </c:forEach>
						       </select></td>
                            <td>
                                <input type = "button" name = "button2" id = "button2" value = "查询" class = "btn1"/>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                    </form>
                </td>
            </tr>
        </table>
        <div class = "p10">
            <table width = "100%" border = "0" cellspacing = "0" cellpadding = "0">
                <tr>
                    <td class = "ico21">&nbsp;</td>
                    <td class = "tb">订单列表</td>
                    <td class = "ico4">&nbsp;</td>
                </tr>
            </table>
            <table width = "100%" border = "0" cellspacing = "0" cellpadding = "0">
                <tr>
                    <td class = "dataGridtool">
                        <table border = "0" cellspacing = "0" cellpadding = "0" class = "fr">
                            <tr>
                               <!--   <td class = "tools2"><a href = "#">修改订单状态</a></td> -->
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
            <div id="datatable">
                <div id="datatable2"></div>
            </div>
        </div>
    </body>
</html>